package xaj.weavingtest.ast.contains_eaj;

import java.util.Set;

import polyglot.ast.Node;
import polyglot.util.Position;
import polyglot.visit.NodeVisitor;

import abc.aspectj.ast.Pointcut_c;
import xaj.weavingtest.ast.contains_eaj.AspectInfoContains;
import abc.weaving.aspectinfo.Pointcut;

public class Contains extends Pointcut_c //implements PCContains
{	
    abc.aspectj.ast.Pointcut param = null;
    
    public Contains(Position pos, abc.aspectj.ast.Pointcut param) {
        super(pos);
        this.param = param;
    }
    
    /*
    // usado no visitor CheckPCContainsStatic
    public abc.aspectj.ast.Pointcut getParam() {
        return param;
    }*/
    
    public boolean isDynamic() {
        return false;
    }
    
    public Pointcut makeAIPointcut() {
        return new AspectInfoContains(position, param.makeAIPointcut());
    }
    
    public Set pcRefs() {
        return param.pcRefs();
    }
    
    Contains reconstruct(abc.aspectj.ast.Pointcut param) {
        Contains ret = this;
        if (param != this.param) {
            ret = new Contains(position, param);
        }
        return ret;
    }
    
    public Node visitChildren(NodeVisitor v) {
        abc.aspectj.ast.Pointcut newParam = 
            (abc.aspectj.ast.Pointcut) visitChild(this.param, v);
        return reconstruct(newParam);
    }
}
